<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        table {
            width: 400px;
            line-height: 30px;
            margin: 50px auto;
            border-collapse: collapse;
        }

        td {
            border: 1px solid #ccc;
            padding: 10px
        }
    </style>
</head>
<body>

    <table>
        <tr>
            <td><input type="checkbox"></td>
            <td>苹果</td>
            <td>100</td>
            <td><button>添加</button></td>
        </tr>

    
    </table>

    <!-- <script src="jquery.js"></script>
    <script>
        //点击添加按钮，复制当前行，并追加table,再将添加改为删除
        $('tr:first button').on('click',function(){
            $(this).closest('tr').clone().appendTo('table').find('button').text('删除')
        })
        //点击删除按钮，删除当前行
        $('table').on('click','tr button:gt(0)',function(){
            // alert('1')
            $(this).closest('tr').remove()
        })

    </script> -->
    <script>
        let btn=document.querySelector('button')
        btn.addEventListener('click',function(){
            
        })
        
    </script>
    
</body>
</html>